<?php

class Core_Model_Action extends Nuo_Db_Table_Row
{

	/**
	 * global type
	 * @property string
	 */
	protected $_globalType = 'action';

	/**
	 * @return string
	 */
	public function getId()
	{
		return $this -> action_id;
	}

	public function getTitle()
	{
		return $this -> title;
	}

	/**
	 * @return string
	 */
	public function getDescription()
	{
		return $this -> description;
	}

	public function getAllows()
	{
		$table =  Nuo::getTable('acl');
		$rows = $table->fetchAll($table->select()->where('action_id=?', $this->action_id)->where('allow=1'));
		
		$arr=  array();
		foreach($rows as $row){
			$arr[] = Nuo::getObject($row->object_id)->getTitle();
		}
		
		return implode(', ', $arr);
		
	}

}
